package com.pinyougou.manager.controller;


import com.github.pagehelper.PageInfo;
import com.pinyougou.pojo.TbTypeTemplate;
import com.pinyougou.sellergoods.service.TypeTemplateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/typeTemplate")
public class TypeTemplateController {
    @Autowired
    private TypeTemplateService templateService;
    @RequestMapping("/list")
    public PageInfo<TbTypeTemplate> findAll(@RequestBody TbTypeTemplate tbTypeTemplate,
                                            @RequestParam(value = "page",required = true,defaultValue = "1")Integer page,
                                            @RequestParam(value = "size",required = true,defaultValue = "5")Integer size){
        PageInfo<TbTypeTemplate> tbTypeTemplatePageInfo = templateService.findAll(tbTypeTemplate,page,size);
        return tbTypeTemplatePageInfo;
    }
}
